(SST) ShlWAPI.pas Version 1.08

Developer Reference
(SST)ShlWAPI PathMakePretty Function
Converts an all upper-case into an all lower-case path string.
Scope
Global (i.e. this function can be called/accessed from code in any unit that includes/uses (SST)ShlWAPI.pas).
Syntax
function PathMakePretty(pszPath : LPSTR) : BOOL;
Parameters
pszPath [in/out] Pointer to the buffer, containing the null-terminated path string to convert. The string/buffer, including the terminating null-character, should not exceed MAX_PATH (= 260) characters in length.
Return Values
If a character case conversion was performed, the function returns TRUE, if not, FALSE.
Remarks
In order for a path string to be converted, it must consist entirely of upper case characters, except, of course, for the path delimiters (e.g. "\", etc.).
If a conversion is performed, the input string is replaced by the converted string, otherwise the input string remains unmodified.
This function's main use, lies primarily in giving short, DOS (i.e. 8 + 3) paths a more consistent appearance, when displayed in GUI environments.
Example
PROCEDURE TForm4.TestShlWAPIPathMakePretty(Sender : TObject); VAR pathbuf : ARRAY[0..MAX_PATH] OF CHAR; VAR apiretval : BOOL; VAR newinfoline : STRING; BEGIN FillChar(pathbuf, Length(pathbuf), #0); apiretval := FALSE; newinfoline := ''; pathbuf := 'C:\Hello\World'; newinfoline := 'PathMakePretty called with ' + pathbuf; Memo1.Lines.Add(newinfoline); apiretval := PathMakePretty(pathbuf); IF apiretval THEN newinfoline := 'TRUE ' + pathbuf ELSE newinfoline := 'FALSE'; Memo1.Lines.Add(newinfoline); pathbuf := 'C:\PROGRAM FILES\MICROSOFT'; newinfoline := 'PathMakePretty called with ' + pathbuf; Memo1.Lines.Add(newinfoline); apiretval := PathMakePretty(pathbuf); IF apiretval THEN newinfoline := 'TRUE ' + pathbuf ELSE newinfoline := 'FALSE'; Memo1.Lines.Add(newinfoline); pathbuf := 'C:\WINDOWS\System32\en-US'; newinfoline := 'PathMakePretty called with ' + pathbuf; Memo1.Lines.Add(newinfoline); apiretval := PathMakePretty(pathbuf); IF apiretval THEN newinfoline := 'TRUE ' + pathbuf ELSE newinfoline := 'FALSE'; Memo1.Lines.Add(newinfoline); Memo1.Lines.Add(''); END;
The above example produces the following output:
PathMakePretty called with C:\Hello\World FALSE PathMakePretty called with C:\PROGRAM FILES\MICROSOFT TRUE C:\program files\microsoft PathMakePretty called with C:\WINDOWS\System32\en-US FALSE
Requirements
Unit: Declared and imported in (SST)ShlWAPI.pas
Library: (SST)ShlWAPI.dcu/(SST)ShlWAPI.obj
Unicode: Implemented as ANSI (PathMakePretty and PathMakePrettyA) and Unicode (PathMakePrettyW) functions.
Min. ShlWAPI.dll version according to MS SDK doc.: 4.71
Min. ShlWAPI.dll version based on SST research: 4.71
Min. OS version(s) according to Microsoft SDK doc.: Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0
Min. OS version(s) according to SST research.: Windows NT 4.0 with IE 4.0, Windows 95 with IE 4.0, Windows 98, Windows 2000 and later
See Also
 
 
Windows APIs: PathMakePretty.


Document/Contents version 1.00
Page/URI last updated on 07.12.2023
 
Copyright © Stoelzel Software Technologie (SST) 2010 - 2017
Suggestions and comments mail to:
webmaster@stoelzelsoftwaretech.com